
package brian.huang.reader;

import android.content.Context;
import android.net.Uri;

import java.io.File;

public class ViewItem {
    private Context mContext;
    private File mFile;
    private String mTitle;

    public ViewItem(Context context, File file) {
        mContext = context;
        mFile = file;
        mTitle = new EpubReader(context, file.getAbsolutePath()).getTitle();
    }

    public Uri getUri() {
        return Uri.fromFile(mFile);
    }

    @Override
    public String toString() {
        if (mTitle == null) {
            return "no data";
        } else {
            return mTitle + "\n" + mFile.getPath() + "";
        }
    }
}
